﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ERPEF.Model
{
    public class pur_Chase_Receipt
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int pr_id { get; set; }
        public string pr_number { get; set; }//采购订单编号
        public string pr_supplier { get; set; }//供货商
        public string pr_attribute { get; set; }//采购商品属性
        public string pr_types { get; set; }//商品种类
        public string pr_operators { get; set; }//操作人员
        public DateTime pr_storage_date { get; set; }//入库时间
        public string pr_supplier_company { get; set; }//供货商公司名称
        public string pr_phone { get; set; }//联系人手机
        public string pr_supplier_address { get; set; }//供货商地址
        public char pr_state { get; set; }//订单状态
        public char pr_wareouse { get; set; }//入库状态
        public bool AuditStatus { get; set; }//审核状态
        public bool IsDeleted { get; set; }//逻辑删除
        public string? auditor { get; set; } //审核人   新增字段
        public DateTime? auditTime { get; set; } //审核时间 新增字段
        public string? out_Return_status { get; set; } //退货状态 新增字段  0：未退货 1：待审核 2：已退货

        public List<pur_Chase_From> pur_Chase_From { get; set; } // 从表数据
        public virtual string ToString()
        {
            if (pur_Chase_From != null && pur_Chase_From.Count > 0)
            {
                return pur_Chase_From.Count + " - " + pur_Chase_From[0].fro_totale;
            }
            else
            {
                return base.ToString(); // 或返回其他默认值  
            }
        }
    }
}
